﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using TareasServiceTest.ServiceReference1;

namespace TareasServiceTest
{
    class Program
    {
        static void Main(string[] args)
        {
            loadProjects();
            addNewTask();
            Console.ReadKey();
        }

        private static void addNewTask()
        {
            TaskServiceClient client = new TaskServiceClient();
            client.addTask(new ServiceReference1.Task() { Title = "Tarea de ejemplo" });
        }


        private static void loadProjects()
        {
            TaskServiceClient client = new TaskServiceClient();
            Project[] projects = client.getProjects();
            foreach (var project in projects)
            {
                client.addTask(new ServiceReference1.Task { Title = "Tarea de ejemplo", RelatedProject = project });
                Console.WriteLine(project.Name);
            }
        }
    }
}
